home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / sat.h.z / sat.h
C/C++ Source or Header  |  1992-04-03  |  22KB  |  718 lines

  1. /**************************************************************************
  2.  *                                      *
  3.  *          Copyright (C) 1988, Silicon Graphics, Inc.          *
  4.  *                                      *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                      *
  11.  **************************************************************************/
  12.  
  13. #ifndef    __SAT_HDR_
  14. #define    __SAT_HDR_
  15.  
  16. #ident "$Header: /src_trees/calypso/att/usr/src/uts/mips/sys/RCS/sat.h,v 1.27 91/12/06 15:55:10 pdc Exp $"
  17.  
  18. #include <sys/types.h>
  19. #include <sys/param.h>  /* for NGROUPS_UMAX */
  20. #include <sys/mac_label.h>
  21.  
  22.     /************************/
  23.     /*    Prototypes      */
  24.     /************************/
  25.  
  26. /* Prototypes for sat user interfaces */
  27. extern int satread( char *, unsigned );
  28. extern int satwrite( int, int, char *, unsigned );
  29. extern int saton( int );
  30. extern int satoff( int );
  31. extern int satstate( int );
  32. extern int satsetid( int );
  33. extern int satgetid( void );
  34.  
  35. extern char *sat_eventtostr( int );
  36. extern int sat_strtoevent( const char * );
  37. extern char *sys_call( int, int );
  38. extern int sat_write_filehdr( int );
  39. extern int sat_close_filehdr( int );
  40.  
  41. #ifdef _KERNEL
  42. /* Prototypes for sat kernel interfaces */
  43.  
  44. extern void sat_init( void );
  45. extern struct mbuf *sat_alloc( int );
  46. extern struct mbuf *sat_pnalloc( int );
  47. extern struct mbuf *sat_kern_alloc( int );
  48. extern void sat_enqueue( struct mbuf * );
  49. extern void sat_kern_enqueue( struct mbuf * );
  50. extern void sat_update_rwdir( struct mbuf *, int );
  51. extern void sat_pnconvert( const char *, int, const char *, char *, int * );
  52. extern void sat_mb_align( struct mbuf * );
  53. extern void sat_mcat( struct mbuf *, struct mbuf * );
  54. extern void sat_mcat_data( int (*)(char *, char *, int),
  55.                struct mbuf *, char *, int );
  56. extern void sat_mcatstr( struct mbuf *, char * );
  57. extern dev_t sat_cttydev( struct proc * );
  58. extern void sat_read( char *, unsigned );
  59. extern void sat_write( int, int, char *, unsigned );
  60. extern void sat_ctl( void );
  61.  
  62. /* Prototypes for "audit points" */
  63.  
  64. extern void sat_access( int, struct mbuf *, int );
  65. extern void sat_acct( char *, struct mbuf * );
  66. extern void sat_bsdipc_addr( int, void *, struct mbuf * );
  67. extern void sat_bsdipc_create( short, void *, short, short );
  68. extern void sat_bsdipc_create_pair( short, void *, short, short, short, void *);
  69. extern void sat_bsdipc_if_config( int, void *, int, struct ifreq * );
  70. extern void sat_bsdipc_if_setlabel( int, void *, struct ifreq *, int );
  71. extern void sat_bsdipc_mac_change( short, void *, mac_label * );
  72. extern void sat_bsdipc_match( struct ip *, mac_label *, struct inpcb * );
  73. extern void sat_bsdipc_missing( struct ifnet *, struct ip * );
  74. extern void sat_bsdipc_range( struct ifnet *, struct ip *, mac_label *, int);
  75. extern void sat_bsdipc_resvport( int, void *, int );
  76. extern void sat_bsdipc_shutdown( short, void *, short );
  77. extern void sat_bsdipc_snoop( void *, mac_label *, int );
  78. extern void sat_check_priv( int );
  79. extern void sat_chmod( struct mbuf *, int );
  80. extern void sat_chown( struct mbuf *, int, int );
  81. extern void sat_chrwdir( struct mbuf *, int );
  82. extern void sat_clock( int );
  83. extern void sat_close( int );
  84. extern void sat_domainname_set( char *, int );
  85. extern void sat_dup( int, int );
  86. extern void sat_exec( struct mbuf *, struct mbuf *, struct mbuf *, int,
  87.     struct mbuf ** );
  88. extern void sat_exit( int );
  89. extern void sat_fchdir( int );
  90. extern void sat_fd_attr_write( struct argnamei * );
  91. extern void sat_fd_read( int );
  92. extern void sat_fd_read2( fd_set * );
  93. extern void sat_tty_setlabel( int, mac_label * );
  94. extern void sat_fd_write( int );
  95. extern void sat_fork( pid_t );
  96. extern void sat_hostid_set( long );
  97. extern void sat_hostname_set( char *, int );
  98. extern void sat_mount( struct mbuf *, struct mbuf *, dev_t );
  99. extern void sat_open( int, int, int, struct mbuf * );
  100. extern void sat_pipe( int, int );
  101. extern void sat_kill( int, pid_t, uid_t, uid_t, mac_label * );
  102. extern void sat_proc_access( int, pid_t, uid_t, uid_t, mac_label * );
  103. extern void sat_setgroups( gid_t * );
  104. extern void sat_setlabel( struct mbuf *, struct mac_label * );
  105. extern void sat_setplabel( struct mbuf *, mac_label * );
  106. extern void sat_setregid( gid_t, gid_t );
  107. extern void sat_setreuid( uid_t, uid_t );
  108. extern void sat_svipc_access( mac_label *, int, int );
  109. extern void sat_svipc_change( int, int, int, int, int, int, int );
  110. extern void sat_svipc_create( key_t, int, int );
  111. extern void sat_svipc_remove( int );
  112. extern void sat_utime( struct mbuf *, time_t *, time_t, time_t );
  113. extern void sat_check_priv( int );
  114. extern void sat_control( int, int, int );
  115. #endif /* _KERNEL */
  116.  
  117.     /*********************/
  118.     /*    Defines      */
  119.     /*********************/
  120.  
  121. /*
  122.  * Major and minor version numbers.  These identify the
  123.  * "version" of the records in a file.
  124.  */
  125. #define    SAT_VERSION_MAJOR    1
  126. #define    SAT_VERSION_MINOR    0
  127. #define    SAT_FILE_MAGIC        "SGIAUDIT"
  128.  
  129. #ifndef TRUE
  130. #define TRUE 1
  131. #endif
  132. #ifndef FALSE
  133. #define FALSE 0
  134. #endif
  135.  
  136. /* handy macro */
  137.  
  138. #define    sat_skip_hdr(m,t)    mtod((m)->m_act,t)
  139.  
  140. /* maximum values */
  141.  
  142. #define SAT_MAX_RECORD        65535    /* maximum kernel record size */
  143. #define SAT_MAX_USER_REC     4000    /* maximum buffer to sat_write */
  144.                     /* (user-level auditing) */
  145. /* SAT outcome bits */
  146.  
  147. #define SAT_UNDEFINED        0xff    /* should never show up in audit file*/
  148. #define SAT_FAILURE        0x00    /* handy, redundant, says '~SUCCESS' */
  149. #define SAT_SUCCESS        0x01    /* 1 = success, 0 = failure          */
  150. #define SAT_DAC            0x02    /* 1 = dac affected outcome, 0 = not */
  151. #define SAT_MAC            0x04    /* 1 = mac affected outcome, 0 = not */
  152. #define SAT_PRIVILEGE        0x08    /* 1 = failed/succeded due to priv.  */
  153.  
  154. /* sat_ctl() commands */
  155.  
  156. #define SATCTL_AUDIT_ON        1
  157. #define SATCTL_AUDIT_OFF    2
  158. #define SATCTL_AUDIT_QUERY    3
  159. #define SATCTL_SET_SAT_ID    4
  160. #define SATCTL_GET_SAT_ID    5
  161. #define SATCTL_LOCALAUDIT_ON    6
  162. #define SATCTL_LOCALAUDIT_OFF    7
  163. #define SATCTL_LOCALAUDIT_QUERY    8
  164. #define SATCTL_REGISTER_SATD    9
  165.  
  166. /* u.u_suser values */
  167. #define SAT_SUSER_CHECKED    0x01    /* we checked u.u_uid == 0 */
  168. #define SAT_SUSER_POSSESSED    0x02    /* our u.u_uid was 0 when checked */
  169.  
  170. /* bitmask for audit events */
  171.  
  172. #define NSATBITS    (sizeof(unsigned long) * NBBY)    /* bits per mask */
  173. #ifndef howmany
  174. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  175. #endif
  176.  
  177. #define    SAT_SET(n, p)    ((p)->ev_bits[(n)/NSATBITS] |= (1 << ((n) % NSATBITS)))
  178. #define    SAT_CLR(n, p)    ((p)->ev_bits[(n)/NSATBITS] &= ~(1 << ((n) % NSATBITS)))
  179. #define    SAT_ISSET(n, p)    ((p)->ev_bits[(n)/NSATBITS] & (1 << ((n) % NSATBITS)))
  180. #define SAT_ZERO(p)    bzero((char *)(p), sizeof(*(p)))
  181.  
  182.     /***************************************/
  183.     /*    Common record definitions      */
  184.     /***************************************/
  185.  
  186. struct    sat_hdr {
  187.     /* fixed-length portion of header (sizeof struct sat_hdr) */
  188.     int    sat_magic;    /* sat header "magic number" -- testing! */
  189.     u_char    sat_rectype;    /* what type of record follows */
  190.     u_char    sat_outcome;    /* failure/success, because of dac/mac check */
  191.     u_char    sat_sequence;    /* sequence number for this record (by type) */
  192.     u_char    sat_errno;    /* system call error number */
  193.     time_t    sat_time;    /* seconds since 1970 */
  194.     u_char    sat_ticks;    /* sub-second clock ticks (0-99) */
  195.     u_char    sat_syscall;    /* system call number */
  196.     u_short    sat_subsyscall;    /* system call "command" number */
  197.     uid_t    sat_id;        /* SAT user-id */
  198.     dev_t    sat_tty;    /* controlling tty, if present */
  199.     pid_t    sat_ppid;    /* parent process id */
  200.     pid_t    sat_pid;    /* process id of record's generator */
  201.     uid_t    sat_euid;    /* Effective user id */
  202.     uid_t    sat_ruid;    /* Real user id */
  203.     gid_t    sat_egid;    /* Effective group id */
  204.     gid_t    sat_rgid;    /* Real group id */
  205.     u_short    sat_hdrsize;    /* total bytes in the header */
  206.     u_short    sat_recsize;    /* bytes in the following record */
  207.     u_short    sat_label_size;    /* how many bytes of label follow? */
  208.     u_short    sat_cwd_len;    /* bytes of current working dir following */
  209.     u_short    sat_root_len;    /* bytes of current root dir following */
  210.     u_char    sat_glist_len;    /* number of multi-group entries */
  211.     u_char    sat_pname_len;    /* process name length */
  212.     /* variable-length portion: size = hdr->sat_hdrsize - sizeof(sat_hdr_t) */
  213.     /* group list */
  214.     /* process label */
  215.     /* current working directory */
  216.     /* current root directory */
  217.     /* process name, from u.u_comm */
  218. };
  219.  
  220. typedef struct    sat_hdr sat_hdr_t;
  221.  
  222. /*
  223.  * Common pathname record.
  224.  * Note: the data for the filenames immediately follows the record.
  225.  */
  226. struct    sat_pathname {
  227.     ino_t sat_inode;
  228.     dev_t sat_device;
  229.     uid_t sat_fileown;
  230.     gid_t sat_filegrp;
  231.     mode_t sat_filemode;
  232.     u_short sat_reqname_len;
  233.     u_short sat_actname_len;
  234.     /* char data[];    */
  235.     /* file label */
  236. };
  237.  
  238. /*
  239.  * The audit file header
  240.  */
  241. struct sat_filehdr {
  242.     char    sat_magic[8];        /* == "SGIAUDIT" */
  243.     u_char    sat_major;        /* version of audit data */
  244.     u_char    sat_minor;
  245.     time_t    sat_start_time;        /* time header written */
  246.     time_t    sat_stop_time;        /* time file closed (added later) */
  247.     long    sat_host_id;        /* host id */
  248.     int    sat_total_bytes;    /* number of bytes to skip past hdr */
  249.     u_short    sat_user_entries;    /* number of sat_user_ent structs */
  250.     u_short    sat_group_entries;    /* number of sat_group_ent structs */
  251.     u_char    sat_timezone_len;    /* bytes of timezone string */
  252.     u_char    sat_hostname_len;    /* bytes of hostname */
  253.     u_char    sat_domainname_len;    /* bytes of domainname */
  254.     /* TZ (timezone) (including trailing null) */
  255.     /* hostname (including trailing null) */
  256.     /* domainname (including trailing null) */
  257.     /* user entries, each word aligned */
  258.     /* group entries, each word aligned */
  259. };
  260.  
  261. struct sat_user_ent {
  262.     uid_t    sat_uid;
  263.     u_short    sat_namelen;
  264.     /* user name (including trailing null) */
  265. };
  266.  
  267. struct sat_group_ent {
  268.     gid_t    sat_gid;
  269.     u_short    sat_namelen;
  270.     /* group name (including trailing null) */
  271. };
  272.  
  273. /*
  274.  * used in the u-area to record current working and root
  275.  * directories
  276.  */
  277. struct    sat_wd {
  278.     u_short cwd_len;
  279.     u_short root_len;
  280.     char data[1];
  281.     /* cwd */
  282.     /* root */
  283. };
  284.  
  285.     /**************************************/
  286.     /*    Audit record definitions      */
  287.     /**************************************/
  288.  
  289. /*
  290.  * These records consist of nothing more than a pathname
  291.  * record and thus have no struct definition:
  292.  *
  293.  *    sat_access_denied
  294.  *    sat_access_failed
  295.  *    sat_chrwdir
  296.  *    sat_rd_symlink
  297.  *    sat_file_crt_del
  298.  *    sat_file_write
  299.  *    sat_file_attr_read
  300.  */
  301.  
  302. struct    sat_open {
  303.     short sat_filedes;
  304.     short sat_file_created;
  305.     int sat_open_flags;
  306.     /* sat_pathname */
  307. };
  308.  
  309. struct    sat_mount {
  310.     dev_t sat_fs_dev;
  311.     short sat_npaths;
  312.     /* sat_pathname device */
  313.     /* sat_pathname mount_point */
  314. };
  315.  
  316. struct    sat_file_attr_write {
  317.     union {
  318.         mode_t sat_filemode;        /* for chmod */
  319.         struct {
  320.             uid_t sat_fileown;
  321.             gid_t sat_filegrp;
  322.         } chown;            /* for chown */
  323.         int sat_label_size;        /* for setlabel */
  324.         struct {
  325.             time_t sat_atime;
  326.             time_t sat_mtime;
  327.         } utime;            /* for utime */
  328.     } newattr;
  329.     /* label, if setlabel */
  330.     /* sat_pathname */
  331. };
  332.  
  333. struct    sat_exec {
  334.     uid_t sat_euid;        /* effective could be set by setuid progs */
  335.     gid_t sat_egid;        /* effective could be set by setgid progs */
  336.     u_char sat_npaths;    /* number of pathname modules following */
  337.     u_char sat_interpreter;    /* is there a shell interpreter? */
  338.     /* sat_pathname */
  339.     /* ... */
  340. };
  341.  
  342. struct    sat_sysacct {
  343.     /* was accounting turned on or off? TRUE=on, FALSE=off */
  344.     int sat_acct_state;
  345. };
  346.  
  347. struct    sat_fchdir {
  348.     int sat_filedes;
  349. };
  350.  
  351. struct    sat_fd_read {
  352.     int sat_filedes;
  353. };
  354.  
  355. struct    sat_fd_read2 {
  356.     fd_set sat_fdset;
  357. };
  358.  
  359. struct sat_tty_setlabel {
  360.     u_short sat_filedes;
  361.     u_short sat_label_size;
  362.     /* tty label */
  363. };
  364.  
  365. struct    sat_fd_write {
  366.     int sat_filedes;
  367. };
  368.  
  369. struct    sat_fd_attr_write {
  370.     int sat_filedes;
  371.     union {
  372.         mode_t sat_filemode;        /* for fchmod */
  373.         struct {
  374.             uid_t sat_fileown;
  375.             gid_t sat_filegrp;
  376.         } fchown;            /* for fchown */
  377.     } newattr;
  378. };
  379.  
  380. struct    sat_pipe {
  381.     short sat_read_filedes;
  382.     short sat_write_filedes;
  383. };
  384.  
  385. struct    sat_dup {
  386.     short sat_old_filedes;
  387.     short sat_new_filedes;
  388. };
  389.  
  390. struct    sat_close {
  391.     int sat_filedes;
  392. };
  393.  
  394. struct    sat_fork {
  395.     pid_t sat_newpid;
  396. };
  397.  
  398. struct    sat_exit {
  399.     int sat_exit_status;
  400. };
  401.  
  402. struct    sat_proc_access {
  403.     pid_t sat_pid;
  404.     uid_t sat_ruid;
  405.     uid_t sat_euid;
  406.     int sat_signal;        /* kill only */
  407.     /* process label */
  408. };
  409.  
  410. struct    sat_proc_own_attr_write {
  411.     union {
  412.         struct {
  413.             uid_t sat_euid;
  414.             uid_t sat_ruid;
  415.         } uid;                /* for setuid, setreuid */
  416.         struct {
  417.             gid_t sat_egid;
  418.             gid_t sat_rgid;
  419.         } gid;                /* for setgid, setregid */
  420.         int sat_label_size;        /* for setplabel */
  421.         int sat_glist_len;        /* for setgroups */
  422.     } newattr;
  423.     /* process label, if setplabel */
  424.     /* group list, if setgroups */
  425. };
  426.  
  427. struct    sat_svipc_access {
  428.     int sat_svipc_id;
  429.     u_short sat_label_size;
  430.     mode_t sat_svipc_perm;
  431.     /* label */
  432. };
  433.  
  434. struct    sat_svipc_create {
  435.     int sat_svipc_id;
  436.     key_t sat_svipc_key;
  437.     mode_t sat_svipc_perm;
  438. };
  439.  
  440. struct    sat_svipc_remove {
  441.     int sat_svipc_id;
  442. };
  443.  
  444. struct    sat_svipc_change {
  445.     int sat_svipc_id;
  446.     uid_t sat_svipc_oldown;
  447.     gid_t sat_svipc_oldgrp;
  448.     mode_t sat_svipc_oldperm;
  449.     uid_t sat_svipc_newown;
  450.     gid_t sat_svipc_newgrp;
  451.     mode_t sat_svipc_newperm;
  452. };
  453.  
  454. struct    sat_bsdipc_create {
  455.     void *    sat_socket;        /* socket identifier         */
  456.     short    sat_socket_dscr;
  457.     short    sat_comm_domain;
  458.     short    sat_protocol;
  459. };
  460.  
  461. struct    sat_bsdipc_create_pair {
  462.     void *    sat_socket;        /* socket identifier         */
  463.     short    sat_socket_dscr;
  464.     short    sat_comm_domain;
  465.     short    sat_protocol;
  466.     short    sat_second_dscr;
  467.     void *    sat_second_socket;    /* second socket identifier    */
  468. };
  469.  
  470. struct    sat_bsdipc_shutdown {
  471.     void *    sat_socket;        /* socket identifier         */
  472.     short    sat_socket_dscr;
  473.     short    sat_how;
  474. };
  475.  
  476. struct    sat_bsdipc_mac_change {
  477.     void *    sat_socket;        /* socket identifier         */
  478.     short    sat_socket_dscr;
  479.     u_short sat_label_size;
  480. /*    mac_label   sat_label;        -  New label on socket         */
  481. };
  482.  
  483. struct    sat_bsdipc_address {
  484.     void *    sat_socket;        /* socket identifier         */
  485.     short    sat_socket_dscr;
  486.     short    sat_addr_len;
  487. /*    char *    sat_socket_addr;    - allocated separately        */
  488. };
  489.  
  490. struct    sat_bsdipc_resvport {
  491.     void *    sat_socket;        /* socket identifier         */
  492.     short    sat_socket_dscr;
  493.     short    sat_port;
  494. };
  495.  
  496. #define SATIFNAMSIZ 16
  497. struct    sat_bsdipc_if_setlabel {
  498.     void *    sat_socket;        /* socket identifier         */
  499.     int    sat_socket_dscr;
  500.     u_long    sat_doi;        /* domain of interpretation    */
  501.     u_char    sat_authority_max;    /* maximum authority allowed    */
  502.     u_char    sat_authority_min;    /* minimum authority permitted    */
  503.     u_char    sat_reserved;        /* must be zero until defined    */
  504.     u_char    sat_idiom;        /* security idiom        */
  505.     short    sat_maxlabel_len;
  506.     short    sat_minlabel_len;
  507.     char    sat_ifname[SATIFNAMSIZ];/* name of intended interface    */
  508. /*    mac_label   sat_label_max;    -  dominates all dgrams on if    */
  509. /*    mac_label   sat_label_min;    -  dominated by all if dgrams     */
  510. };
  511.  
  512. struct    sat_bsdipc_if_config {
  513.     void *    sat_socket;        /* socket identifier         */
  514.     short    sat_socket_dscr;
  515.     short    sat_ifreq_len;
  516.     int    sat_ioctl_cmd;
  517. /*    struct ifreq sat_ifreq;        - allocated separately        */
  518. };
  519.  
  520. struct    sat_bsdipc_match {
  521.     void *    sat_socket;        /* socket identifier         */
  522.     u_short sat_ip_len;
  523.     u_short sat_label_len;
  524. /*    struct ip sat_ip;        -  ip header & port numbers    */
  525. /*    mac_label   sat_label;        -  Label on datagram         */
  526. };
  527.  
  528. struct    sat_bsdipc_snoop {
  529.     void *    sat_socket;        /* socket identifier         */
  530.                     /* <<< NEED MORE HERE ??? >>>    */
  531.     u_short sat_label_len;
  532. /*    mac_label   sat_label;        -  Label on datagram         */
  533. };
  534.  
  535. /* used for rx and tx out of range errors, and tx and rx OK */
  536. struct    sat_bsdipc_range {  
  537.     char    sat_ifname[SATIFNAMSIZ];/* name of interface        */
  538.     u_short sat_ip_len;
  539.     u_short sat_label_len;
  540. /*    struct ip sat_ip;        -  ip datagram header (only!)    */
  541. /*    mac_label   sat_label;        -  Label on datagram         */
  542. };
  543.  
  544. struct    sat_bsdipc_missing {  /* IP security option missing or malformed */
  545.     char    sat_ifname[SATIFNAMSIZ];/* name of interface        */
  546.     u_short sat_ip_len;        /* length of following ip hdr    */
  547. /*    struct ip sat_ip;        -  ip datagram header & options    */
  548. };
  549.  
  550. struct    sat_clock_set {
  551.     long sat_newtime;
  552. };
  553.  
  554. /*
  555.  * sat_hostname_set and sat_domainname_set consist of
  556.  * nothing more than a null-terminated string and thus
  557.  * have no struct definition.
  558.  */
  559.  
  560. struct    sat_hostid_set {
  561.     long sat_newhostid;
  562. };
  563.  
  564. struct    sat_check_priv {
  565.     int sat_priv_state;    /* did they possess superuser privilege? */
  566. };
  567.  
  568. struct sat_control {
  569.     int sat_cmd;        /* satctl command (e.g. SATCTL_AUDIT_ON) */
  570.     int sat_arg;        /* argument (depends on command) */
  571.     pid_t sat_pid;        /* pid (depends on command) */
  572. };
  573.  
  574.     /*********************************/
  575.     /*    System call numbers      */
  576.     /*********************************/
  577.  
  578. /*
  579.  * Selected system call numbers.  This is not intended to be
  580.  * a complete list.  Add new entries on an as-needed basis.
  581.  * (these must stay up to date with uts/mips/os/sysent.c)
  582.  *
  583.  * SAT_SYSCALL_KERNEL is for kernel-direct messages that are not
  584.  * the result of some system call (timetrim, for example).
  585.  */
  586. #define SAT_SYSCALL_KERNEL    255
  587.  
  588. #define SAT_SYSCALL_ACCESS     33
  589. #define SAT_SYSCALL_CHDIR     12
  590. #define SAT_SYSCALL_CHMOD     15
  591. #define SAT_SYSCALL_CHOWN     16
  592. #define SAT_SYSCALL_CHROOT     61
  593. #define SAT_SYSCALL_CLOSE      6
  594. #define SAT_SYSCALL_CREAT      8
  595. #define SAT_SYSCALL_DUP         41
  596. #define SAT_SYSCALL_EXEC     11
  597. #define SAT_SYSCALL_EXECE     59
  598. #define SAT_SYSCALL_EXIT      1
  599. #define SAT_SYSCALL_FORK      2
  600. #define SAT_SYSCALL_FCHDIR    147
  601. #define SAT_SYSCALL_FCHMOD    153
  602. #define SAT_SYSCALL_FCHOWN    152
  603. #define SAT_SYSCALL_KILL     37
  604. #define SAT_SYSCALL_LINK      9
  605. #define SAT_SYSCALL_MKDIR     80
  606. #define SAT_SYSCALL_MKNOD     14
  607. #define SAT_SYSCALL_MOUNT     21
  608. #define SAT_SYSCALL_OPEN      5
  609. #define SAT_SYSCALL_PIPE     42
  610. #define SAT_SYSCALL_RENAME    114
  611. #define SAT_SYSCALL_RMDIR     79
  612. #define SAT_SYSCALL_SETGID     46
  613. #define SAT_SYSCALL_SETREGID    123
  614. #define SAT_SYSCALL_SETREUID    124
  615. #define SAT_SYSCALL_SETUID     23
  616. #define SAT_SYSCALL_SYSSGI     40
  617. #define SAT_SYSCALL_STAT     18
  618. #define SAT_SYSCALL_TRUNCATE    112
  619. #define SAT_SYSCALL_UMOUNT     22
  620. #define SAT_SYSCALL_UNLINK     10
  621. #define SAT_SYSCALL_UTIME     30
  622.  
  623.     /******************************/
  624.     /*    SAT record types      */
  625.     /******************************/
  626. /*
  627.  * If you add or remove a record type, update sat_init in sat.c as well
  628.  * as the sat_eventtostr library function (event-to-string mapping).
  629.  */
  630.  
  631. /* Path name record types */
  632. #define SAT_FILE_HEADER        0    /* special type for SAT file headers */
  633. #define SAT_ACCESS_DENIED    1    /* file access denied */
  634. #define SAT_ACCESS_FAILED    2    /* file access failed (e.g. no file) */
  635. #define SAT_CHDIR        3    /* change working directory */
  636. #define SAT_CHROOT        4    /* change root directory */
  637. #define SAT_OPEN        5    /* file open */
  638. #define SAT_OPEN_RO        6    /* file open, read only */
  639. #define SAT_READ_SYMLINK    7    /* read symbolic link */
  640. #define SAT_FILE_CRT_DEL    8    /* file creation/deletion */
  641. #define SAT_FILE_CRT_DEL2    9    /* as above with two pathnames */
  642. #define SAT_FILE_WRITE        10    /* file data write */
  643. #define SAT_MOUNT        11    /* mount/unmount */
  644. #define SAT_FILE_ATTR_READ    12    /* file attribute read */
  645. #define SAT_FILE_ATTR_WRITE    13    /* file attribute write */
  646. #define SAT_EXEC        14    /* exec */
  647. #define SAT_SYSACCT        15    /* system accounting */
  648. /* File descriptor record types */
  649. #define SAT_FCHDIR        20    /* change working directory via fd */
  650. #define SAT_FD_READ        21    /* read file data or attrs via fd */
  651. #define SAT_FD_READ2        22    /* as above with a set of fd's */
  652. #define SAT_TTY_SETLABEL    23    /* tty reclassify (ioctl) */
  653. #define SAT_FD_WRITE        24    /* write file data via fd */
  654. #define SAT_FD_ATTR_WRITE    25    /* write file attributes via fd */
  655. #define SAT_PIPE        26    /* create a pipe */
  656. #define SAT_DUP            27    /* duplicate a descriptor */
  657. #define SAT_CLOSE        28    /* close a descriptor */
  658. /* Process record types */
  659. #define SAT_FORK        40    /* create a new process */
  660. #define SAT_EXIT        41    /* destroy a (this) process */
  661. #define SAT_PROC_READ        42    /* read a process's addr space */
  662. #define SAT_PROC_WRITE        43    /* write a process's addr space */
  663. #define SAT_PROC_ATTR_READ    44    /* read a process's attributes */
  664. #define SAT_PROC_ATTR_WRITE    45    /* change a process's attributes */
  665. #define SAT_PROC_OWN_ATTR_WRITE    46    /* change this process's attributes */
  666. /* System V IPC record types */
  667. #define SAT_SVIPC_ACCESS    50    /* System V IPC access */
  668. #define SAT_SVIPC_CREATE    51    /* System V IPC create */
  669. #define SAT_SVIPC_REMOVE    52    /* System V IPC remove */
  670. #define SAT_SVIPC_CHANGE    53    /* System V IPC change */
  671. /* BSD IPC record types */
  672. #define    SAT_BSDIPC_CREATE    60    /* socket, accept */
  673. #define    SAT_BSDIPC_CREATE_PAIR    61    /* socketpair */
  674. #define    SAT_BSDIPC_SHUTDOWN    62    /* shutdown */
  675. #define    SAT_BSDIPC_MAC_CHANGE    63    /* setsockopt */
  676. #define    SAT_BSDIPC_ADDRESS    64    /* bind, connect, accept syscalls */
  677. #define SAT_BSDIPC_RESVPORT    65    /* bind to reserved port */
  678. #define SAT_BSDIPC_DELIVER    66    /* rx pkt delivered to socket    */
  679. #define SAT_BSDIPC_CANTFIND    67    /* rx pkt no match on port/label */
  680. #define SAT_BSDIPC_SNOOP_OK    68    /* raw socket delivery permitted */
  681. #define SAT_BSDIPC_SNOOP_FAIL    69    /* raw socket delivery denied    */
  682.  
  683. /* Public object record types */
  684. #define SAT_CLOCK_SET        70    /* set the system clock */
  685. #define SAT_HOSTNAME_SET    71    /* set the host name */
  686. #define SAT_DOMAINNAME_SET    72    /* set the domain name */
  687. #define SAT_HOSTID_SET        73    /* set the host id */
  688. /* other record types */
  689. #define SAT_CHECK_PRIV        80    /* make-or-break privilege checks */
  690. #define SAT_CONTROL        81    /* audit controls */
  691.  
  692. /* more BSD IPC types */
  693. #define SAT_BSDIPC_RX_OK    90    /* rx pkt label in range    */
  694. #define SAT_BSDIPC_RX_RANGE    91    /* rx pkt label out of range    */
  695. #define SAT_BSDIPC_RX_MISSING    92    /* rx pkt label missing/malformed */
  696. #define SAT_BSDIPC_TX_OK    93    /* tx pkt label in range    */
  697. #define SAT_BSDIPC_TX_RANGE    94    /* tx pkt label out of range    */
  698. #define SAT_BSDIPC_TX_TOOBIG    95    /* tx pkt label doesn't fit    */
  699. #define SAT_BSDIPC_IF_CONFIG    96    /* configure interface address    */
  700. #define    SAT_BSDIPC_IF_INVALID    97    /* ioctl SIOCSIFLABEL disallowed */
  701. #define SAT_BSDIPC_IF_SETLABEL    98    /* ioctl SIOCSIFLABEL succeeded */
  702.  
  703. /* record types for user-level records generated with satwrite(2) */
  704. #define SAT_USER_RECORDS    100    /* beginning of non-kernel auditing */
  705. #define SAT_AE_AUDIT        100    /* audit subsys reporting on itself */
  706. #define SAT_AE_IDENTITY        101    /* identification & authentication */
  707. #define SAT_AE_DBEDIT        102    /* admin database editor */
  708. #define SAT_AE_MOUNT        103    /* mount / unmount */
  709. #define SAT_AE_CUSTOM        104    /* user-defined */
  710.  
  711. #define SAT_NTYPES        110    /* max record type + 1 (or greater) */
  712.  
  713. typedef    struct sat_ev_mask {
  714.     unsigned long    ev_bits[howmany(SAT_NTYPES, NSATBITS)];
  715. } sat_event_mask;
  716.  
  717. #endif    /* __SAT_HDR_ */
  718.